home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip Kasım 2000.iso / prog / share / 11 / setup.exe / %MAINDIR% / DEMOS / CIFTP / FTPEXP / servers / server.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-09-07  |  7.8 KB  |  247 lines

  1. VERSION 4.00
  2. Begin VB.Form Server 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "FTP Server"
  5.    ClientHeight    =   3510
  6.    ClientLeft      =   1860
  7.    ClientTop       =   1890
  8.    ClientWidth     =   5370
  9.    Height          =   3915
  10.    Icon            =   "Server.frx":0000
  11.    Left            =   1800
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3510
  16.    ScaleWidth      =   5370
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1545
  19.    Width           =   5490
  20.    Begin VB.PictureBox picFrame 
  21.       Appearance      =   0  'Flat
  22.       BorderStyle     =   0  'None
  23.       ForeColor       =   &H80000008&
  24.       Height          =   1575
  25.       Left            =   285
  26.       ScaleHeight     =   1575
  27.       ScaleWidth      =   4800
  28.       TabIndex        =   14
  29.       Top             =   1200
  30.       Width           =   4800
  31.       Begin VB.TextBox txtServer 
  32.          Height          =   285
  33.          Index           =   3
  34.          Left            =   1155
  35.          PasswordChar    =   "*"
  36.          TabIndex        =   10
  37.          Top             =   1125
  38.          Width           =   3540
  39.       End
  40.       Begin VB.TextBox txtServer 
  41.          Height          =   285
  42.          Index           =   2
  43.          Left            =   1155
  44.          TabIndex        =   8
  45.          Top             =   765
  46.          Width           =   3540
  47.       End
  48.       Begin VB.TextBox txtServer 
  49.          Height          =   285
  50.          Index           =   1
  51.          Left            =   1155
  52.          TabIndex        =   6
  53.          Top             =   405
  54.          Width           =   3540
  55.       End
  56.       Begin VB.TextBox txtServer 
  57.          Height          =   285
  58.          Index           =   0
  59.          Left            =   1155
  60.          TabIndex        =   4
  61.          Top             =   45
  62.          Width           =   3540
  63.       End
  64.       Begin VB.Label lblGeneric 
  65.          Caption         =   "&Password:"
  66.          Height          =   195
  67.          Index           =   6
  68.          Left            =   15
  69.          TabIndex        =   9
  70.          Top             =   1155
  71.          Width           =   1080
  72.       End
  73.       Begin VB.Label lblGeneric 
  74.          Caption         =   "&Login Name:"
  75.          Height          =   195
  76.          Index           =   5
  77.          Left            =   15
  78.          TabIndex        =   7
  79.          Top             =   795
  80.          Width           =   1080
  81.       End
  82.       Begin VB.Label lblGeneric 
  83.          Caption         =   "Host &Address:"
  84.          Height          =   195
  85.          Index           =   4
  86.          Left            =   15
  87.          TabIndex        =   5
  88.          Top             =   435
  89.          Width           =   1080
  90.       End
  91.       Begin VB.Label lblGeneric 
  92.          BackStyle       =   0  'Transparent
  93.          Caption         =   "Host &Name:"
  94.          Height          =   195
  95.          Index           =   1
  96.          Left            =   15
  97.          TabIndex        =   3
  98.          Top             =   60
  99.          Width           =   1110
  100.       End
  101.    End
  102.    Begin VB.TextBox txtAlias 
  103.       Height          =   285
  104.       Left            =   690
  105.       MaxLength       =   40
  106.       TabIndex        =   1
  107.       Top             =   150
  108.       Width           =   4425
  109.    End
  110.    Begin VB.CommandButton cmdCancel 
  111.       Cancel          =   -1  'True
  112.       Caption         =   "Cancel"
  113.       Height          =   375
  114.       Left            =   4155
  115.       TabIndex        =   12
  116.       Top             =   3030
  117.       Width           =   1125
  118.    End
  119.    Begin VB.CommandButton cmdOK 
  120.       Caption         =   "OK"
  121.       Default         =   -1  'True
  122.       Enabled         =   0   'False
  123.       Height          =   375
  124.       Left            =   2970
  125.       TabIndex        =   11
  126.       Top             =   3030
  127.       Width           =   1125
  128.    End
  129.    Begin VB.Label lblReadMe 
  130.       Caption         =   "A simple set of information about a FTP server. Expand as needed."
  131.       ForeColor       =   &H00800000&
  132.       Height          =   465
  133.       Left            =   120
  134.       TabIndex        =   13
  135.       Top             =   3030
  136.       Visible         =   0   'False
  137.       Width           =   2700
  138.    End
  139.    Begin VB.Label lblGeneric 
  140.       Caption         =   "Alia&s:"
  141.       Height          =   195
  142.       Index           =   0
  143.       Left            =   150
  144.       TabIndex        =   0
  145.       Top             =   180
  146.       Width           =   465
  147.    End
  148.    Begin ComctlLib.TabStrip tabServer 
  149.       Height          =   2190
  150.       Left            =   105
  151.       TabIndex        =   2
  152.       TabStop         =   0   'False
  153.       Top             =   705
  154.       Width           =   5175
  155.       _Version        =   65536
  156.       _ExtentX        =   9128
  157.       _ExtentY        =   3863
  158.       _StockProps     =   68
  159.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  160.          Name            =   "MS Sans Serif"
  161.          Size            =   8.25
  162.          Charset         =   0
  163.          Weight          =   400
  164.          Underline       =   0   'False
  165.          Italic          =   0   'False
  166.          Strikethrough   =   0   'False
  167.       EndProperty
  168.       ImageList       =   ""
  169.       i1              =   "Server.frx":014A
  170.    End
  171. Attribute VB_Name = "Server"
  172. Attribute VB_Creatable = False
  173. Attribute VB_Exposed = False
  174. Option Explicit
  175. '----------------------------------------------------
  176. '<Purpose> Enables adding, and maintaing FTP Servers.
  177. ' Can be easily made into an OLE server.
  178. '----------------------------------------------------
  179. '<Constant>------------------------------------------
  180. Const svrHostName       As Integer = 0
  181. Const svrHostAddress    As Integer = 1
  182. Const svrLoginName      As Integer = 2
  183. Const svrPassword       As Integer = 3
  184. '</Constant>-----------------------------------------
  185. '<Public>--------------------------------------------
  186. Public PressedOK        As Boolean
  187. Public ThisServer       As FTPServer
  188. Public Mode             As Integer
  189. Public MyCaption        As String
  190. '</Public>-------------------------------------------
  191. Private Sub cmdCancel_Click()
  192.     PressedOK = False
  193.     Unload Me
  194. End Sub
  195. Private Sub cmdOK_Click()
  196.     '---- if in add mode, create a new class object
  197.     If (Mode = ciAdd) Then
  198.         Set ThisServer = New FTPServer
  199.     End If
  200.     '---- save the information about the host
  201.     With ThisServer
  202.         .Alias = txtAlias
  203.         .HostName = txtServer(svrHostName)
  204.         .HostAddress = txtServer(svrHostAddress)
  205.         .LoginName = txtServer(svrLoginName)
  206.         .Password = txtServer(svrPassword)
  207.     End With
  208.         
  209.     PressedOK = True
  210.     Unload Me
  211. End Sub
  212. Private Sub Form_Load()
  213.     If (MyCaption <> "") Then
  214.         Me.Caption = MyCaption
  215.     End If
  216.     If (Mode = ciProperties) Then
  217.         '---- display the host information
  218.         With ThisServer
  219.             txtAlias = .Alias
  220.             txtServer(svrHostName) = .HostName
  221.             txtServer(svrHostAddress) = .HostAddress
  222.             txtServer(svrLoginName) = .LoginName
  223.             txtServer(svrPassword) = .Password
  224.         End With
  225.     End If
  226.     Call GetWindowState(Me, "ciFTPServerWindow", False)
  227. End Sub
  228. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  229.     If (Not (UnloadMode = vbFormCode)) Then
  230.         PressedOK = False
  231.     End If
  232.     Call SetWindowState(Me, "ciFTPServerWindow")
  233. End Sub
  234. Private Sub Form_Terminate()
  235.     '---- explicitly clean up all objects
  236.     Set ThisServer = Nothing
  237. End Sub
  238. Private Sub txtAlias_Change()
  239.     cmdOK.Enabled = (txtAlias <> "")
  240. End Sub
  241. Private Sub txtAlias_GotFocus()
  242.     Call SelectText(txtAlias)
  243. End Sub
  244. Private Sub txtServer_GotFocus(Index As Integer)
  245.     Call SelectText(txtServer(Index))
  246. End Sub
  247.